home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / solutions.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1997-03-01  |  26KB  |  499 lines

  1. #!/bin/sh
  2. #
  3. # The following SunSolutions script launches httpd, waissearch, and Netscape 
  4. # on Solaris SPARC, Solaris x86, and SunOS
  5. # Author: Marc Sacoolas (marc.sacoolas@sun.com)
  6. #   Date: April 4, 1995
  7. # below is for the cgi-scripts
  8. DISC_NAME=Sun-Solutions_CD-April-1997
  9. # below is for everything else
  10.  
  11. disc_name="SunSolutions";disc_rest="Sun Solutions CD April 1997"
  12. export disc_name disc_rest
  13.  
  14. # initialize variables
  15.  
  16. dir_exist=0
  17. echo ""
  18. echo "          $disc_rest initializing ..."
  19. echo ""
  20.                         
  21. # set CDMOUNT to path from the command line arguements
  22.  
  23. CDMOUNT=`expr \
  24.         $0'/' : '\(/\)[^/]*//*$' \
  25.         \| $0'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \
  26.         \| .`
  27. # if command line path is current directory then set CDMOUNT to pwd
  28. # CDMOUNT cannot be set to . because other programs/scripts
  29. # need the absolute path in CD_MOUNT
  30. if [ "$CDMOUNT" = "." ]; then
  31.         CDMOUNT=`pwd`
  32. fi
  33.  
  34. CD_MOUNT=$CDMOUNT
  35.  
  36. export CD_MOUNT dir_exist
  37.  
  38. if [ -h $HOME/.netscape/lock ]; then
  39.     echo '\07'
  40.         echo "It looks like you are currently running Netscape Navigator."
  41.         echo "You should quit it before running $disc_rest!"
  42.         echo "Press <RETURN> to continue or <CTRL> C to abort..."
  43.         read a
  44. fi
  45.  
  46. # os type and arch
  47.  
  48. check_os()
  49. {
  50.         os_ver="`/bin/uname -r | /bin/grep 5\[.]`"
  51.         export os_ver
  52.  
  53.         if [ -n "$os_ver" ]; then
  54. # must be running Solaris 2.x
  55.                 machine_type="`/bin/uname -m`"
  56.                 os_type="`/bin/uname -r`"
  57.                 if [ "$machine_type" = "i86pc" ]; then
  58.                         OS_TYPE=""
  59.                         CDWARE_ENV=Solaris_x86
  60.                 else
  61. # must be on a SPARCarchitecture-based machine
  62.                         bcp="`/bin/pkginfo | /bin/grep SUNWbcp`"
  63. # check for bcp and set CDWARE_ENV accordingly???
  64.                         CDWARE_ENV=Solaris_2
  65.                 fi
  66.         else
  67. # must be running Solaris 1.x
  68.                 GUI=products/bin/Solaris_1/cdmanager
  69.                 GUI_BIN=cdmgr
  70.                 CDWARE_ENV=Solaris_1
  71.         fi
  72.  
  73. #
  74. # CDWARE_HOME used by screendemo, slidecacher, and seaudio
  75. #
  76. CDWARE_HOME=$CDMOUNT/products/bin/$CDWARE_ENV$OS_TYPE
  77.  
  78. export GUI CDWARE_ENV CDWARE_HOME OS_TYPE
  79. }
  80. # print out legal text as required by the lawyers
  81. echo " "    
  82. cat $CD_MOUNT/products/$disc_name/text/legal.txt
  83.  
  84. check_os
  85. #### SUNOS PATCH INFORMATION ADDED 3/19/97 ###
  86.  
  87. #    if [ "$CDWARE_ENV" = "Solaris_1" ]; then
  88. #    $OPENWINHOME/bin/cmdtool -Wb 250 250 210 -Wl "SunOS Patch Information" -Wx large -Ww 80 -Wh 30 -Wp 100 100 $CDMOUNT/products/bin/httpd/$CDWARE_ENV/patch.sh
  89. #    fi
  90. ####                        ###
  91.  
  92.  
  93. if [ "$OPENWINHOME" != "" ]; then
  94.     OPENWINHOME="/usr/openwin"; export OPENWINHOME    
  95. fi
  96.  
  97. export LD_LIBRARY_PATH HOTJAVA_HOME CLASSPATH PATH
  98.  
  99. LD_LIBRARY_PATH=$CD_MOUNT/products/.lib/$CDWARE_ENV/lib:/usr/openwin/lib:/usr/lib
  100. CLASSPATH=./:$CD_MOUNT/products/bin/gui/$CDWARE_ENV:$CD_MOUNT/products/bin/gui//classes:$CD_MOUNT/products/$disc_name/classes
  101. if [ "$CDWARE_ENV" = "Solaris_1" ]; then
  102. PATH=/tmp/httpd/.cgi-bin:/usr/ucb:$OPENWINHOME/bin:/usr/bin:/usr/sbin:$PATH
  103. XNLSPATH=$CD_MOUNT/products/bin/gui/$CDWARE_ENV/nls
  104. XKEYSYMDB=$CD_MOUNT/products/bin/gui/$CDWARE_ENV
  105. else
  106. PATH=/tmp/httpd/.cgi-bin:/usr/bin:$OPENWINHOME/bin:/usr/sbin:$PATH
  107. fi
  108.  
  109. # play welcome audio clip
  110.  
  111. if [ -w /dev/audio ]; then 
  112.  
  113.   if [ $CDWARE_ENV != "Solaris_1" ]; then
  114.     audioplay -i $CD_MOUNT/products/$disc_name/sounds/welcome.au&
  115.         PID_AUDIO=$!
  116.   else
  117.     cat $CD_MOUNT/products/$disc_name/sounds/welcome.au > /dev/audio&
  118.         PID_AUDIO=$!
  119.   fi
  120.  
  121.  
  122. fi
  123.  
  124. # play welcome mpeg file
  125.  
  126. PRODUCT_DIR=$CD_MOUNT/products
  127. export PRODUCT_DIR 
  128.  
  129. export WWW_HOME WWW_FIRST
  130.  
  131. # move only needed files and symlink for "file" URLs, if necessary
  132.  
  133. if [ ! -d /tmp/httpd ]; then
  134.     mkdir /tmp/httpd
  135.     mkdir /tmp/httpd/bin
  136.     mkdir /tmp/httpd/cache
  137. # excite read-only problem
  138.     mkdir /tmp/httpd/collections
  139.     chmod 777 /tmp/httpd/collections
  140.     cp -r $CD_MOUNT/products/bin/httpd/conf /tmp/httpd
  141.     cp -r $CD_MOUNT/products/bin/httpd/logs /tmp/httpd&
  142.     chmod -R 777 /tmp/httpd
  143.  
  144.     ln -s $PRODUCT_DIR /tmp/httpd/.products 
  145. fi
  146. if [ ! -h /tmp/httpd/.excite ]; then
  147.         ln -s $PRODUCT_DIR/bin/Excite/$CDWARE_ENV /tmp/httpd/.excite
  148. fi
  149.  
  150. if [ "$CDWARE_ENV" != "Solaris_x86" ]; then
  151. # get around read-only excite problem
  152.  
  153.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.cf /tmp/httpd/collections/SunSol.cf
  154.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.conf /tmp/httpd/collections/SunSol.conf
  155.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.dat /tmp/httpd/collections/SunSol.dat
  156.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.dir /tmp/httpd/collections/SunSol.dir
  157.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.fdat /tmp/httpd/collections/SunSol.fdat
  158.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.fidx /tmp/httpd/collections/SunSol.fidx
  159.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.fnam /tmp/httpd/collections/SunSol.fnam
  160.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.idf /tmp/httpd/collections/SunSol.idf
  161.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.idx /tmp/httpd/collections/SunSol.idx
  162.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.info /tmp/httpd/collections/SunSol.info
  163.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.inv /tmp/httpd/collections/SunSol.inv
  164.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.key /tmp/httpd/collections/SunSol.key
  165.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.last /tmp/httpd/collections/SunSol.last
  166.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.lpt /tmp/httpd/collections/SunSol.lpt
  167.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.lst /tmp/httpd/collections/SunSol.lst
  168.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.norm /tmp/httpd/collections/SunSol.norm
  169.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.norm.raw /tmp/httpd/collections/SunSol.norm.raw
  170.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.prog /tmp/httpd/collections/SunSol.prog
  171.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.ptr /tmp/httpd/collections/SunSol.ptr
  172.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.size /tmp/httpd/collections/SunSol.size
  173.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.sum /tmp/httpd/collections/SunSol.sum
  174.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.trp /tmp/httpd/collections/SunSol.trp
  175.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.unstem /tmp/httpd/collections/SunSol.unstem
  176.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol.ver /tmp/httpd/collections/SunSol.ver
  177.     ln -s  /tmp/httpd/.products/bin/Excite/collections/SunSol_one.idx /tmp/httpd/collections/SunSol_one.idx
  178.  
  179. # get around read-only excite problem
  180.  
  181.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.cf /tmp/httpd/collections/catalyst.cf
  182.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.conf /tmp/httpd/collections/catalyst.conf
  183.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.dat /tmp/httpd/collections/catalyst.dat
  184.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.dir /tmp/httpd/collections/catalyst.dir
  185.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.fdat /tmp/httpd/collections/catalyst.fdat
  186.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.fidx /tmp/httpd/collections/catalyst.fidx
  187.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.fnam /tmp/httpd/collections/catalyst.fnam
  188.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.idf /tmp/httpd/collections/catalyst.idf
  189.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.idx /tmp/httpd/collections/catalyst.idx
  190.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.info /tmp/httpd/collections/catalyst.info
  191.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.inv /tmp/httpd/collections/catalyst.inv
  192.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.key /tmp/httpd/collections/catalyst.key
  193.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.last /tmp/httpd/collections/catalyst.last
  194.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.lpt /tmp/httpd/collections/catalyst.lpt
  195.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.lst /tmp/httpd/collections/catalyst.lst
  196.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.norm /tmp/httpd/collections/catalyst.norm
  197.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.norm.raw /tmp/httpd/collections/catalyst.norm.raw
  198.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.prog /tmp/httpd/collections/catalyst.prog
  199.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.ptr /tmp/httpd/collections/catalyst.ptr
  200.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.size /tmp/httpd/collections/catalyst.size
  201.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.sum /tmp/httpd/collections/catalyst.sum
  202.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.trp /tmp/httpd/collections/catalyst.trp
  203.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.unstem /tmp/httpd/collections/catalyst.unstem
  204.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst.ver /tmp/httpd/collections/catalyst.ver
  205.         ln -s  /tmp/httpd/.products/bin/Excite/collections/catalyst_one.idx /tmp/httpd/collections/catalyst_one.idx
  206.  
  207. else
  208.  #read-only excite problem
  209.  
  210.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.cf /tmp/httpd/collections/SunSol.cf
  211.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.conf /tmp/httpd/collections/SunSol.conf
  212.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.dat /tmp/httpd/collections/SunSol.dat
  213.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.dir /tmp/httpd/collections/SunSol.dir
  214.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.fdat /tmp/httpd/collections/SunSol.fdat
  215.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.fidx /tmp/httpd/collections/SunSol.fidx
  216.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.fnam /tmp/httpd/collections/SunSol.fnam
  217.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.idf /tmp/httpd/collections/SunSol.idf
  218.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.idx /tmp/httpd/collections/SunSol.idx
  219.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.info /tmp/httpd/collections/SunSol.info
  220.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.inv /tmp/httpd/collections/SunSol.inv
  221.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.key /tmp/httpd/collections/SunSol.key
  222.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.last /tmp/httpd/collections/SunSol.last
  223.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.lpt /tmp/httpd/collections/SunSol.lpt
  224.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.lst /tmp/httpd/collections/SunSol.lst
  225.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.norm /tmp/httpd/collections/SunSol.norm
  226.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.norm.raw /tmp/httpd/collections/SunSol.norm.raw
  227.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.prog /tmp/httpd/collections/SunSol.prog
  228.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.ptr /tmp/httpd/collections/SunSol.ptr
  229.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.size /tmp/httpd/collections/SunSol.size
  230.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.sum /tmp/httpd/collections/SunSol.sum
  231.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.trp /tmp/httpd/collections/SunSol.trp
  232.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.unstem /tmp/httpd/collections/SunSol.unstem
  233.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol.ver /tmp/httpd/collections/SunSol.ver
  234.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/SunSol_one.idx /tmp/httpd/collections/SunSol_one.idx
  235.  
  236. # get around read-only excite problem
  237.  
  238.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.cf /tmp/httpd/collections/catalyst.cf
  239.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.conf /tmp/httpd/collections/catalyst.conf
  240.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.dat /tmp/httpd/collections/catalyst.dat
  241.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.dir /tmp/httpd/collections/catalyst.dir
  242.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.fdat /tmp/httpd/collections/catalyst.fdat
  243.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.fidx /tmp/httpd/collections/catalyst.fidx
  244.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.fnam /tmp/httpd/collections/catalyst.fnam
  245.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.idf /tmp/httpd/collections/catalyst.idf
  246.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.idx /tmp/httpd/collections/catalyst.idx
  247.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.info /tmp/httpd/collections/catalyst.info
  248.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.inv /tmp/httpd/collections/catalyst.inv
  249.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.key /tmp/httpd/collections/catalyst.key
  250.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.last /tmp/httpd/collections/catalyst.last
  251.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.lpt /tmp/httpd/collections/catalyst.lpt
  252.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.lst /tmp/httpd/collections/catalyst.lst
  253.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.norm /tmp/httpd/collections/catalyst.norm
  254.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.norm.raw /tmp/httpd/collections/catalyst.norm.raw
  255.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.prog /tmp/httpd/collections/catalyst.prog
  256.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.ptr /tmp/httpd/collections/catalyst.ptr
  257.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.size /tmp/httpd/collections/catalyst.size
  258.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.sum /tmp/httpd/collections/catalyst.sum
  259.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.trp /tmp/httpd/collections/catalyst.trp
  260.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.unstem /tmp/httpd/collections/catalyst.unstem
  261.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst.ver /tmp/httpd/collections/catalyst.ver
  262.         ln -s  /tmp/httpd/.products/bin/Excite/Solaris_x86/collections/catalyst_one.idx /tmp/httpd/collections/catalyst_one.idx
  263.  
  264. fi
  265. # create temp mailcap file
  266.     key=$
  267.     #MAILCAP=/tmp/.mailcap
  268.     #export MAILCAP
  269.     echo "application/x-key-sh; /bin/sh %s " > /tmp/httpd/.$disc_name
  270.     echo "video/*; /tmp/httpd/.cgi-bin/xanim -geometry =10X10+675+210 +Ss1.25 +Av10 %s " >> /tmp/httpd/.$disc_name
  271.     echo "application/pdf; /tmp/httpd/.cgi-bin/acroread %s " >> /tmp/httpd/.$disc_name
  272.     # Pageview is better for postscript, but less forgiving.  Need different PS viewer.
  273.     if [ "$CDWARE_ENV" = "Solaris_1" ]; then
  274.     echo "application/postscript; $OPENWINHOME/bin/pageview %s " >> /tmp/httpd/.$disc_name
  275.     else
  276.     echo "application/postscript; $OPENWINHOME/bin/imagetool %s " >> /tmp/httpd/.$disc_name
  277.     fi
  278.  
  279. echo $PID_AUDIO >/tmp/httpd/sound.pid
  280.  
  281. # needed srm.conf doc for httpd conf
  282.  
  283. echo ""
  284. echo "     NCSA World Wide Web server initializing ..."        
  285. echo ""
  286. echo "        Portions developed at the National Center"
  287. echo "        for Supercomputing Applications at the"
  288. echo "        University of Illinois at Urbana-Champaign."    
  289. echo ""    
  290.  
  291. if [ ! -h /tmp/httpd/.cgi-bin ]; then
  292.     ln -s $PRODUCT_DIR/bin/httpd/$CDWARE_ENV /tmp/httpd/.cgi-bin
  293. fi
  294.  
  295. # if slower machine, use non-imaged mapped page
  296.  
  297. if [ "`/bin/uname -m | sed 's/sun4//g'" = "c" -o "`/bin/uname -m | sed 's/i86//g'" = "pc" -a "$1" != "fast" -o "$1" = "slow"  ]; then
  298.     ln -s $PRODUCT_DIR/$disc_name/index4c.html /tmp/httpd/index.html
  299.     WWW_HOME=file:///tmp/httpd/.products/SunSolutions/index4c.html
  300.     WWW_FIRST=http://localhost:7999/cgi-bin/killsound.pl?slow
  301. else
  302.     ln -s $PRODUCT_DIR/$disc_name/index4x.html /tmp/httpd/index.html
  303.     WWW_HOME=file:///tmp/httpd/.products/SunSolutions/index4x.html
  304.     WWW_FIRST=http://localhost:7999/cgi-bin/killsound.pl?fast
  305. fi
  306.  
  307. echo "DocumentRoot $CD_MOUNT/products" > /tmp/httpd/conf/srm.conf
  308. echo 'UserDir public_html' >> /tmp/httpd/conf/srm.conf
  309. echo 'HeaderName public_html' >> /tmp/httpd/conf/srm.conf
  310. echo 'DirectoryIndex index.html' >> /tmp/httpd/conf/srm.conf
  311. echo 'FancyIndexing on' >> /tmp/httpd/conf/srm.conf
  312. echo 'AddType application/x-key-sh .sh' >> /tmp/httpd/conf/srm.conf
  313. echo 'AddType application/postscript .ps .eps .ai' >> /tmp/httpd/conf/srm.conf
  314. echo 'AddType application/compressed .Z' >> /tmp/httpd/conf/srm.conf
  315. echo 'AddType video/movie .mov' >> /tmp/httpd/conf/srm.conf
  316. echo 'AddIconByType (TXT,/icons/text.xbm) text/*' >> /tmp/httpd/conf/srm.conf
  317. echo 'AddIconByType (IMG,/icons/image.xbm) image/*' >> /tmp/httpd/conf/srm.conf
  318. echo 'AddIconByType (SND,/icons/sound.xbm) audio/*' >> /tmp/httpd/conf/srm.conf
  319. echo 'AddIcon /icons/movie.xbm .mpg .qt' >> /tmp/httpd/conf/srm.conf
  320. echo 'AddIcon /icons/binary.xbm bin' >> /tmp/httpd/conf/srm.conf
  321. echo 'AddIcon /icons/back.xbm ..' >> /tmp/httpd/conf/srm.conf
  322. echo 'AddIcon /icons/menu.xbm ^^DIRECTORY^^' >> /tmp/httpd/conf/srm.conf
  323. echo 'AddIcon /icons/blank.xbm ^^BLANKICON^^' >> /tmp/httpd/conf/srm.conf
  324. echo 'DefaultIcon /icons/unknown.xbm' >> /tmp/httpd/conf/srm.conf
  325. echo 'ReadmeName README' >> /tmp/httpd/conf/srm.conf
  326. echo 'HeaderName HEADER' >> /tmp/httpd/conf/srm.conf
  327. echo 'IndexIgnore */.??* *~ *# */HEADER* */README*' >> /tmp/httpd/conf/srm.conf
  328. echo 'AccessFileName .htaccess' >> /tmp/httpd/conf/srm.conf
  329. echo 'DefaultType text/plain' >> /tmp/httpd/conf/srm.conf
  330. echo "ScriptAlias /.categories/ /tmp/httpd/.cgi-bin/show.bat" >> /tmp/httpd/conf/srm.conf
  331. echo "ScriptAlias /cgi-bin/ $CD_MOUNT/products/bin/httpd/cgi-bin/" >> /tmp/httpd/conf/srm.conf
  332. echo "ScriptAlias /JavaWorld/cgi-bin/ $CD_MOUNT/products/JavaWorld/cgi-bin/" >> /tmp/httpd/conf/srm.conf
  333. echo "ScriptAlias /SunWorld/cgi-bin/ $CD_MOUNT/products/SunWorld/cgi-bin/" >> /tmp/httpd/conf/srm.conf
  334. #echo "Alias /docs/ $CD_MOUNT/products/$disc_name/docs/" >> /tmp/httpd/conf/srm.conf
  335.  
  336. if [ "$CDWARE_ENV" = "Solaris_1" ]; then 
  337. echo "Alias /catalog/SunSolutions.frame.html /tmp/httpd/.products/catalog/sunos.html" >> /tmp/httpd/conf/srm.conf
  338. echo "Alias /catalog/index.html /tmp/httpd/.products/catalog/sunos.html" >> /tmp/httpd/conf/srm.conf
  339. echo "Alias /index.html /tmp/httpd/.products/catalog/sunos.html" >> /tmp/httpd/conf/srm.conf
  340. echo "Alias /catalog/index.htm /tmp/httpd/.products/catalog/sunos.html" >> /tmp/httpd/conf/srm.conf
  341. fi 
  342.  
  343. # generate access.conf file
  344.  
  345. echo '<Directory /tmp/httpd/>' >> /tmp/httpd/conf/access.conf
  346. echo 'Options Indexes FollowSymLinks' >> /tmp/httpd/conf/access.conf
  347. echo '</Directory>' >> /tmp/httpd/conf/access.conf
  348. echo "<Directory $CD_MOUNT/products/*>" >> /tmp/httpd/conf/access.conf
  349. echo 'Options Indexes FollowSymLinks ExecCGI' >> /tmp/httpd/conf/access.conf
  350. echo 'AllowOverride All' >> /tmp/httpd/conf/access.conf
  351. echo '<Limit GET>' >> /tmp/httpd/conf/access.conf
  352. echo 'order allow,deny' >> /tmp/httpd/conf/access.conf
  353. echo 'allow from all' >> /tmp/httpd/conf/access.conf
  354. echo '</Limit>' >> /tmp/httpd/conf/access.conf
  355. echo '</Directory>' >> /tmp/httpd/conf/access.conf
  356.  
  357. # append ServerName to http file for disc specification
  358.  
  359. echo "ServerName $DISC_NAME" >> /tmp/httpd/conf/httpd.conf-dist
  360.  
  361. # Check to see if the user is root, if so, change to
  362. # "-nobody" 
  363. #
  364.  
  365. USER=`/usr/ucb/whoami`
  366. if [ "$USER" = "root" ]; then
  367.         echo "User nobody" >>/tmp/httpd/conf/httpd.conf-dist
  368.         if [ "$CDWARE_ENV" = "Solaris_1" ]; then 
  369.         echo "Group nogroup" >>/tmp/httpd/conf/httpd.conf-dist
  370.         else
  371.         echo "Group nobody" >>/tmp/httpd/conf/httpd.conf-dist
  372.         fi 
  373. fi
  374.  
  375. # launch wais search deamen
  376.  
  377. if [ "$CDWARE_ENV" = "Solaris_1" ]; then 
  378.     
  379.    ln -s $PRODUCT_DIR/$disc_name/waisSearch.html /tmp/httpd/search.html
  380.    ln -s $PRODUCT_DIR/$disc_name/index4c.wais.html /tmp/httpd/index4c.html
  381.    ln -s $PRODUCT_DIR/$disc_name/index4x.wais.html /tmp/httpd/index4x.html
  382.  
  383.     # if "/tmp/httpd/.wais" symlink is not already there, then
  384.     # create link for wais-src and wais on CDrom
  385.  
  386.  
  387.     if [ ! -h /tmp/httpd/.wais ]; then
  388.         ln -s $PRODUCT_DIR/.wais /tmp/httpd
  389.     fi
  390.  
  391.     echo "     Launching WAIS server ..."
  392.     echo ""
  393.     echo "          Copyright (c) MCNC, Clearinghouse for Networked"
  394.     echo "          Information Discovery and Retrieval, 1993."
  395.  
  396.    /tmp/httpd/.cgi-bin/waisserver -p 7998 -d $CD_MOUNT/products/.wais/wais_SunSolutions >/tmp/httpd/waisserver.log 2>&1 &
  397.   PID_CDROM=$!
  398.  
  399.   export PID_CDROM
  400. else
  401.    ln -s $PRODUCT_DIR/$disc_name/exciteSearch.html /tmp/httpd/search.html
  402.    ln -s $PRODUCT_DIR/$disc_name/index4c.excite.html /tmp/httpd/index4c.html
  403.    ln -s $PRODUCT_DIR/$disc_name/index4x.excite.html /tmp/httpd/index4x.html
  404.  
  405.  
  406. fi 
  407.  
  408.  
  409. #launch httpd
  410.  
  411. $CD_MOUNT/products/bin/httpd/cgi-bin/httpd -f /tmp/httpd/conf/httpd.conf-dist
  412.  
  413. echo ""
  414. echo "        NOTE: If you have internet access through" 
  415. echo "        a fire-wall, you may have to set a \"proxy\""
  416. echo "        server under \"Network options\" in Netscape." 
  417.  
  418.  
  419. if [ "$NETSCAPE_CATALYST" = "" ]; then
  420.         PATH=$PATH:$CD_MOUNT/products/bin/gui/$CDWARE_ENV
  421.         NETSCAPE_VERSION="`netscape -version 2>&1| /tmp/httpd/.cgi-bin/perl -n -e 's?\D*([0-9.]*).*?\1? ? print : print "none"'`"
  422.         #NETSCAPE_VERSION="2.00"
  423.  
  424.         #POST_VERSION_201=`echo $NETSCAPE_VERSION|/tmp/httpd/.cgi-bin/perl -n -e '/2\.(\d[2-9]|[1-9]\d)/ || /[3-9]\./ ? print "post" : print "ant"'`
  425.         POST_VERSION_300=`echo $NETSCAPE_VERSION|/tmp/httpd/.cgi-bin/perl -n -e '/3\.(\d[1-9]|[1-9]\d)/ || /[4-9]\./ ? print "post" : print "ant"'`
  426.         #POST_VERSION_300=`echo $NETSCAPE_VERSION|/tmp/httpd/.cgi-bin/perl -n -e '/[3-9]\./ ? print "post" : print "ant"'`
  427.         #echo "POST_VERSION_300="$POST_VERSION_300
  428.         if [ $POST_VERSION_300 = "post" ];then
  429.                 echo
  430.                 echo "WARNING: a version of Netscape Navigator 3.00 or later has been detected in your PATH!"
  431.                 echo "Netscape Navigator "$NETSCAPE_VERSION" will be used for the Sun Solutions CD"
  432.  
  433.  
  434.                 echo ""
  435.                 #echo $PATH
  436.                 NETSCAPE_CATALYST=`echo $PATH|/tmp/httpd/.cgi-bin/perl -n -e '
  437.                         @DIRS=split(/:/);
  438.                         foreach $dir (@DIRS) {
  439.                                 if (-x "$dir/netscape" && -f _) {
  440.                                         print "$dir/netscape\n";
  441.                                         last;
  442.                                 }
  443.                         }'`
  444.         fi
  445. fi
  446.                 export NETSCAPE_CATALYST
  447.  
  448.  
  449. if [ -f $HOME/.netscape/preferences ]; then
  450. #change
  451.    perl -p -i.solutions -e 's?^NO_PROXY:.*$?NO_PROXY: localhost?;
  452.                 s?^PROXY_MODE:.*$?PROXY_MODE:   1?;
  453.                 s?^SHOW_DIRECTORY_BUTTONS:.*$?SHOW_DIRECTORY_BUTTONS:   False?;
  454.                 s?^SHOW_URL:.*$?SHOW_URL:       True?;
  455.         s?^AUTOLOAD_IMAGES:.*$?AUTOLOAD_IMAGES:      True?;
  456.                 s?^PERSONAL_MIME_TYPES:.*$?PERSONAL_MIME_TYPES: /tmp/httpd/conf/mime.types?;        
  457.                 #s?^MAILCAP:.*$?MAILCAP: /tmp/httpd/.SunSolutions?;
  458.                 #s?^MIME_TYPES:.*$?MIME_TYPES:   /tmp/httpd/conf/mime.types?;
  459.                 s?^PERSONAL_MAILCAP:.*$?PERSONAL_MAILCAP:       /tmp/httpd/.SunSolutions?;        
  460.                 s?^HOME_DOCUMENT:.*$?HOME_DOCUMENT:     $ENV{"WWW_HOME"}?;
  461.                 s?^DISABLE_JAVA:.*$?DISABLE_JAVA:       False?;
  462.         s?^SHOW_TOOLBAR:.*$?SHOW_TOOLBAR:         True?;
  463.         s?^WARN_ENTER_SECURE:.*$?WARN_ENTER_SECURE:      False?;
  464.         s?^WARN_LEAVE_SECURE:.*$?WARN_LEAVE_SECURE:      False?;
  465.         s?^WARN_MIXED_SECURE:.*$?WARN_MIXED_SECURE:      False?;
  466.         s?^WARN_SUBMIT_INSECURE:.*$?WARN_SUBMIT_INSECURE:   False?;
  467.         s?^SHOW_URL:.*$?SHOW_URL:             True?;
  468.         s?^SHOW_DIRECTORY_BUTTONS:.*$?SHOW_DIRECTORY_BUTTONS:  False?;
  469.         s?^FTP_FILE_INFO:.*$?FTP_FILE_INFO:        True?;
  470.         s?^SHOW_SECURITY_BAR:.*$?SHOW_SECURITY_BAR    True?;
  471.                 s?^FONT_SPEC:[  ]*([^-]*)-([^-]*)-([^-]*)-(.*)$?FONT_SPEC: \1-\2-140-\4?;
  472.    ' $HOME/.netscape/preferences
  473.  
  474.   dir_exist=1
  475. else
  476.   cp -r $CD_MOUNT/products/bin/gui/.netscape $HOME
  477.   dir_exist=0
  478. fi
  479.  
  480.  
  481. echo ""
  482. echo "$disc_rest is starting ..."
  483. echo ""
  484. echo "Please note the following:" 
  485. echo "--------------------------" 
  486. echo "- To run many of the slide shows there must be at least 5 megabytes" 
  487. echo "  of available disk space in /tmp.  Please verify the available disk" 
  488. echo "  space in /tmp before running the slide shows." 
  489. echo " " 
  490. echo " " 
  491.  
  492. # cleanup previous line, if any
  493. if [ -f $HOME/.mailcap ]; then
  494. perl -nei 'print unless $_ =~ "application/x-spam-sh; /bin/sh %s"' $HOME/.mailcap > /tmp/httpd/.mailcap; cp /tmp/httpd/.mailcap $HOME/.mailcap
  495. fi 
  496. $CD_MOUNT/products/bin/finish.sh &
  497. sleep 60 
  498. exit 0
  499.